﻿
namespace Softserve.WcfServices.Logic
{
    using System;
    using Softserve.Pottery;
    using System.Collections.Generic;
    using Softserve.Pottery.Infrastructure;
    using Softserve.Pottery.Manufacturing;
    using Softserve.Pottery.Manufacturing.Contracts;
    using Softserve.Pottery.Manufacturing.Domains;

    public class ManufacturingLogic : IManufacturingScopeContract
    {
        public ManufacturingLogic()
        {

        }

        #region IApprovementContract

        public Approvement CreateApprovement(int id, int MasterId, Batch batch, ProductionStage currentStage, List<int> productsId, int quantityAfterModeling = default(int), int quantityAfterRoasting = default(int), int quantityAfterPainting = default(int))
        {
            return controller.CreateApprovement(id, MasterId, batch, currentStage, productsId, quantityAfterModeling, quantityAfterRoasting, quantityAfterPainting);
        }

        public Approvement EditQuantityAfterModeling(int quantityAfterModeling, Approvement item)
        {
            return controller.EditQuantityAfterModeling(quantityAfterModeling, item);
        }

        public Approvement EditQuantityAfterRoasting(int quantityAfterRoasting, Approvement item)
        {
            return controller.EditQuantityAfterRoasting(quantityAfterRoasting, item);
        }

        public Approvement EditQuantityAfterPainting(int quantityAfterPainting, Approvement item)
        {
            return controller.EditQuantityAfterPainting(quantityAfterPainting, item);
        }

        public Approvement Approve(Approvement item)
        {
            return controller.Approve(item);
        }

        #endregion

        #region IBatchContract

        public Batch CreateBatch(int id, DateTime dateCreated, int masterId, List<int> itemCollection, MaterialType material, List<int> approvementListId)
        {
            return controller.CreateBatch(id, dateCreated, masterId, itemCollection, material, approvementListId);
        }

        #endregion

        #region IPlanContract

        public Plan CreatePlan(int teamId, DateTime dateBegin, List<Batch> batches, DateTime dateFinished)
        {
            return controller.CreatePlan(teamId, dateBegin, batches, dateFinished);
        }

        #endregion

        #region ITeamContract

        public Team CreateNewTeam(int id, int masterId, int performance, double defectPercent)
        {
            return controller.CreateNewTeam(id, masterId, performance, defectPercent);
        }

        public Team SetNewPerformance(int performance, Team item)
        {
            return controller.SetNewPerformance(performance, item);
        }

        public Team SetNewDfectPercent(double defectPercent, Team item)
        {
            return controller.SetNewDfectPercent(defectPercent, item);
        }

        #endregion

        #region  Private

        private readonly ManufacturingController controller;

        #endregion

    }
}
